package ca.ericslandry.client.gin;

import net.customware.gwt.presenter.client.DefaultEventBus;
import net.customware.gwt.presenter.client.EventBus;
import net.customware.gwt.presenter.client.gin.AbstractPresenterModule;
import ca.ericslandry.client.mvp.presenter.ContentPresenter;
import ca.ericslandry.client.mvp.presenter.HeaderPresenter;
import ca.ericslandry.client.mvp.presenter.IssueListPresenter;
import ca.ericslandry.client.mvp.presenter.IssuePresenter;
import ca.ericslandry.client.mvp.presenter.MainPresenter;
import ca.ericslandry.client.mvp.presenter.PlacesPresenter;
import ca.ericslandry.client.mvp.presenter.UserPresenter;
import ca.ericslandry.client.mvp.view.ContentView;
import ca.ericslandry.client.mvp.view.HeaderView;
import ca.ericslandry.client.mvp.view.IssueListView;
import ca.ericslandry.client.mvp.view.IssueView;
import ca.ericslandry.client.mvp.view.MainView;
import ca.ericslandry.client.mvp.view.PlacesView;
import ca.ericslandry.client.mvp.view.UserView;

import com.allen_sauer.gwt.log.client.Log;
import com.google.inject.Singleton;

/**
 * Gin and MVP configuration
 */
public class Module extends AbstractPresenterModule {
	@Override
	protected void configure() {
		Log.debug("bindPresenter");
		bind(EventBus.class).to(DefaultEventBus.class).in(Singleton.class);
		bindPresenter(MainPresenter.class, MainPresenter.Display.class, MainView.class);
		bindPresenter(UserPresenter.class, UserPresenter.Display.class, UserView.class);
		bindPresenter(HeaderPresenter.class, HeaderPresenter.Display.class, HeaderView.class);
		bindPresenter(ContentPresenter.class, ContentPresenter.Display.class, ContentView.class);
		bindPresenter(IssueListPresenter.class, IssueListPresenter.Display.class, IssueListView.class);
		bindPresenter(IssuePresenter.class, IssuePresenter.Display.class, IssueView.class);
		bindPresenter(PlacesPresenter.class, PlacesPresenter.Display.class, PlacesView.class);
	}
}